*******************************************************************************
***
*** Stata syntax to merge the Harmonized Income Dataset version 1 (HID v1) 
*** with the individual-level file from the Survey Data Recycling Master Box v1 
*** (SDR_Master_File_1_0.sav, DOI:10.7910/DVN/VWGF5Q).
***
***
*** Please note that the SDR dataset to use is SDR_Master_File_1_0.sav,
*** i.e. the SPSS version. The Stata version has an error in the t_case_id
*** variable and will not merge with the HID v1 file.
***
*** Marta Kołczyńska and Przemek Powałko. 2019. Harmonized Income Dataset v.1.
***
*******************************************************************************

* set working directory
cd "set your directory here"

* open the HID data file
use "HID_data_v1.dta" // opens the HID v1 file

* merge HID with the SDR individual-level file
merge 1:1 t_case_id t_source_table using "SDR_Master_File_1_0.dta"

